import { getInfo } from "@/api"
import { ElMessage } from "element-plus"
import { setSession } from "@/util/tools"

export const useGetUerInfo = async (phoneNumber) => {
  const res = await getInfo(phoneNumber)
  if (res.code === 200) {
    setSession("userInfo", res.data)
    return true
  } else {
    ElMessage.error(res.message)
    return false
  }
}
